import React from "react";
import FetchUser from '../FetchUser'
import './index.css';

export default class FetchUserBtn extends React.Component {
    state = {
        id: 9527,
    }

    onIdChange = () => {
        this.setState({
            id: this.state.id + 1,
        })
    }

    onGetUser = user => {
        console.log('user', user);
    }

    render() {
        const { id } = this.state;
        return <>
            <button className="btn-change-user" onClick={this.onIdChange}>Change User {id}</button>
            <FetchUser id={id} />
        </>
    }
}